<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>

<iframe src="getCommonAccInfo.do?bankcard_uuid=${bankcard_uuid}" width="100%"
	frameborder="0" scrolling="no" height="100%"
	onload="javascript:SetCwinHeight(this)"></iframe>
<div style="margin: 20px 0;"></div>
<jiepos:workFlowListTag system_type="t_app_custom_bankcard"
	system_key="${bankcard_uuid}" code_tp="AUDIT_ST"></jiepos:workFlowListTag>

<div style="margin: 20px 0;"></div>
<form id="reviewAccForm"  name="reviewAccForm" method="post">
    	<input type="hidden" id="custom_uuid" name="custom_uuid" value="${custom_uuid}"/>
    	<input type="hidden" id="bankcard_uuid" name="bankcard_uuid" value="${bankcard_uuid}"/>
		<div>
			<span style="font-size: 12px;vertical-align: top;">审核意见</span>
			<textarea name="audit_comments" value="${appWorkFlowTraceEntity.audit_comments}" cols="30" rows="10" maxlength="150"></textarea>
		</div>
</form>

<div style="text-align:center;padding:5px">
 			<!-- <a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-ok" id ="saveBtn" onclick="reviewpass()">审核通过</a>
 			<a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-edit" onclick="backModify() ">返回修改</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-back" onclick="back()">返回</a> -->
	    	
	    	<jiepos:buttonDetailTag menuCode="${menuCode}" formId="reviewAccForm"></jiepos:buttonDetailTag>
</div>


<script>
function reviewpass(urls){
		if($("#reviewAccForm").form("validate")){
			var options ={
                    url:'<c:url value="../settleaccount/checkBankcard.do"/>',
                    type:'post',
                    success:function(data){
                        if("success" == data){
                            //表单提交的方法、比如ajax提交
                            $("#reviewAccForm").attr("action",urls);
                            $("#reviewAccForm").submit();
                        }else{
                            $.jpmessage.info('该卡号已被审核!');
                        }
                    }
                };
                $("#reviewAccForm").ajaxSubmit(options);
		}
		
	};


function SetCwinHeight(obj) {
	var cwin = obj;
	if (document.getElementById) {
		if (cwin && !window.opera) {
			if (cwin.contentDocument
					&& cwin.contentDocument.body.offsetHeight)
				cwin.height = cwin.contentDocument.body.offsetHeight + 30;
			else if (cwin.Document && cwin.Document.body.scrollHeight)
				cwin.height = cwin.Document.body.scrollHeight + 30;
		}
	}
}

function backModify(urls){
	var audit_comments = $("textarea[name='audit_comments']").val();
	if(audit_comments == null || audit_comments == ""){
		$.jpmessage.info('请填写审核意见!');
		return;
	}
	if(audit_comments.length >= 500){
		$.jpmessage.info('审核意见最多输入500字符!');
		return;
	}
	if($("#reviewAccForm").form("validate")){
		var options ={
                url:'<c:url value="../settleaccount/checkBankcard.do"/>',
                type:'post',
                success:function(data){
                	if("success" == data){
                		//表单提交的方法、比如ajax提交
                        $("#reviewAccForm").attr("action",urls);
                        document.getElementById("reviewAccForm").submit();
                    }else {
                    	$.jpmessage.info('该卡号已被审核!'); 
                    }
                }
            };
            $("#reviewAccForm").ajaxSubmit(options);
	}
};
</script>